package com.lx.lib.app;

import android.app.Application;
import android.content.Context;
import android.support.multidex.MultiDex;

import com.lx.commonlib.utils.CrashHandler;
import com.lx.commonlib.utils.LogUtil;
import com.lx.commonlib.utils.ui.ResourcesUtil;
import com.lx.lib.BuildConfig;
import com.lx.lib.utils.FileManager;

/**
 * 类说明：Application 类
 * Created by liuxiong on 2019/3/23.
 */

public class MyApplication extends Application{

    private Context mContext;

    @Override
    public void onCreate() {
        super.onCreate();
        mContext=getApplicationContext();
        //log工具类
        LogUtil.init(BuildConfig.ISDEBUG,"---com.lx.mylibrary");
        //资源工具类
        ResourcesUtil.init(mContext);
        //项目文件夹初始化
        FileManager.getInstance().init(mContext);
        //异常捕获处理
        CrashHandler.getInstance().init(mContext,FileManager.getInstance().getRootPath());
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(base);
    }
}
